package com.cxzl.pcxt.action.front;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.cxzl.pcxt.entity.Paper;
import com.cxzl.pcxt.entity.User;
import com.cxzl.pcxt.service.PaperService;

@Controller("pcxtPaperAction")
@RequestMapping("paper")
public class PaperAction {

	@Resource(name = "pcxtPaperService")
	private PaperService paperService;

	@RequestMapping("list")
	public String list(ModelMap model, HttpServletRequest req) {
		// 判断用户是否登录
//		User user = (User) req.getSession().getAttribute(User.USER_SESSION_ID);
//		if (user == null) {
//			return "redirect:/loginPage.htm";
//		}
		List<Paper> list = paperService.findByList();
		model.addAttribute("paperList", list);
		return "pcxt/mobile/paper/list";
	}
}
